package com.changgou.goods.feign;

import com.changgou.entity.Result;
import com.changgou.goods.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/****
 * @Author: https://blog.csdn.net/pkxwyf
 *****/
@FeignClient(name = "goods")
@RequestMapping("/sku")
public interface SkuFeign {

    /**
     * 根据 spuid查询skulist
     * @return
     */
    @GetMapping("/spuid")
    List<Sku> findBySpuId(@RequestParam String spuid);

    @GetMapping("/all")
    List<Sku> findAllSku();

    @GetMapping("/{id}")
    public Result<Sku> findById(@PathVariable String id);

    @PostMapping("/decr/count")
    public Result decrCount(@RequestParam("username") String username);
}